import Vue from "vue";
import Router from "vue-router";
import Login from "@/views/login"
import Main from "@/views/main";
import Error404 from "@/views/error"

//import App from './app'

// 产品列表， 角色授权路由
import Role from "./role"

//资源管理的相关资源路由
import Resource from "./resource"

// 租户管理相关页面路由
import TenantManage from "./tenantManage"

Vue.use(Router);

const router = new Router({
    mode: "hash",
    routes: [
        {
            path:"", redirect: "/login"
        },
        {
            path: "/login",
            component: Login
        },
        {
            path: "/main",
            component: Main,
            children: [
                ...Role,
                ...Resource,
                ...TenantManage,
            ]
        },
        {
            path: "/404",
            component: Error404,
        }
        
    ]
});
export default router